package com.lwq.nacos.grayscale.controller;

import com.lwq.nacos.grayscale.feign.TestFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order-service")
@Slf4j
public class TestController {

    @Autowired
    private TestFeignClient testFeignClient;


    @GetMapping("sayHello")
    public String sayHello(){
        //return "hello";
        return "hello222";
    }


    @GetMapping("testFeignSayHello")
    public String testFeignSayHello(){
        log.info("testFeignSayHello call sayHello");
        return testFeignClient.sayHello();
    }
}
